/**
 * 
 */
package org.log4jconfig.xml.editor.quickfix;

import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolutionGenerator2;
import org.log4jconfig.xml.editor.utils.Logger;
import org.log4jconfig.xml.editor.validation.ContentValidator;

/**
 * @author Xavier  
 *
 */
public class AnyDeprecatedElementMarkerResolutionGenerator implements
		IMarkerResolutionGenerator2 {

	public boolean hasResolutions(IMarker marker) {
		try {
			if(ContentValidator.DEPRECATED_ELEMENT_MARKER_ID.equals(marker.getType())) {
				return true;
			}
		} catch (CoreException e) {
			Logger.error("Unable to retrieve marker type due to " + e.getMessage(), e);
		}
		return false;
	}

	public IMarkerResolution[] getResolutions(IMarker marker) {
		return new IMarkerResolution[]{new AllDeprecatedElementsReplaceQuickFix()};
	}

	

}
